package util

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func HttpGet(url string) []byte {
	// 发送 GET 请求
	resp, err := http.Get(url)
	if err != nil {
		fmt.Println("Error:", err)
		return nil
	}
	defer resp.Body.Close()

	// 读取响应体
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response body:", err)
		return nil
	}

	return body
}
